package lab02.test33;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test33 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();

        Scanner sc = new Scanner(System.in);

        System.out.println("请输入若干个单词：");

        String str = sc.nextLine();
        String[] arr = str.split(" ");

        for (int i = 0; i < arr.length; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[i].compareToIgnoreCase(arr[j])>0){
                    str=arr[i];
                    arr[i]=arr[j];
                    arr[j]=str;
                }
            }

        }
        for (String n : arr) {

            list.add(n);
            System.out.print(n + " ");
        }

    }
}
